<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:rich="http://richfaces.org/rich"
	xmlns:a4j="http://richfaces.org/a4j">

<h:head></h:head>
<body>
	<f:view locale="#{language.locale}">
		<style>
.wdc {
	background-color: rgb(255, 235, 218);
	color: rgb(255, 120, 0);
	font-weight: bold;
	font-style: italic;
}

.phc {
	background-color: pink;
	color: red;
	font-weight: bold;
	font-style: italic;
}

.lac {
	background-color: rgb(221, 160, 221);
	color: rgb(138, 43, 226);
	font-weight: bold;
	font-style: italic;
}

.lpc {
	background-color: rgb(152, 251, 152);
	color: rgb(34, 139, 34);;
	font-weight: bold;
	font-style: italic;
}

.rf-ca-boundary-dates {
	color: gray;
}

*.rf-cal-c {
	width: 50px;
	height: 30px;
}

.normal-dates {
	background-color: rgb(255, 255, 255);
	color: black;
	font-weight: normal;
}
</style>
		<center>
			<h:outputText value="#{leaveRequest.left}" escape="false" />

			<rich:dataTable value="#{leaveRequest.leaves}" var="his" border="1">
				<rich:column width="200px">
					<f:facet name="header">#{msg['leaveno']}</f:facet>
				#{his.leaveID}
			</rich:column>
				<rich:column>
					<f:facet name="header">#{msg['datefrom']}</f:facet>
				#{his.dateFrom}
			</rich:column>
				<rich:column>
					<f:facet name="header">#{msg['dateto']}</f:facet>
				#{his.dateTo}
			</rich:column>
				<rich:column>
					<f:facet name="header">#{msg['days']}</f:facet>
				#{his.days}
			</rich:column>
				<rich:column>
					<f:facet name="header">#{msg['reason']}</f:facet>
				#{his.reason}
			</rich:column>
				<rich:column>
					<f:facet name="header">#{msg['status']}</f:facet>
				#{his.status}
			</rich:column>
				<rich:column>
					<f:facet name="header">#{msg['lt']}</f:facet>
				#{his.type}
			</rich:column>
				<rich:column>
					<f:facet name="header">#{msg['remarks']}</f:facet>
				#{his.remark}
			</rich:column>
				<rich:column>
					<f:facet name="header">#{msg['action']}</f:facet>
					<h:form>
						<h:commandLink action="#{leaveRequest.leaveAction}"
							value="#{eMessage.cancelRequest()}" rendered="#{his.flag==1}"
							onclick="if (! confirm('#{eMessage.cr()}')) return false">
							<f:param name="type" value="1" />
							<f:param name="LID" value="#{his.leaveID}" />
						</h:commandLink>
					</h:form>
					<h:form>
						<h:commandLink action="#{leaveRequest.leaveAction}"
							value="#{eMessage.cancelLeave()}" rendered="#{his.flag==3}"
							onclick="if (! confirm('#{eMessage.cla()}')) return false">
							<f:param name="type" value="3" />
							<f:param name="LID" value="#{his.leaveID}" />
						</h:commandLink>
					</h:form>
					<h:form>
						<h:commandLink action="#{leaveRequest.leaveAction}"
							value="#{eMessage.undoCancel()}" rendered="#{his.flag==5}"
							onclick="if (! confirm('#{eMessage.uc()}')) return false">
							<f:param name="type" value="5" />
							<f:param name="LID" value="#{his.leaveID}" />
						</h:commandLink>
					</h:form>
				</rich:column>
			</rich:dataTable>
			<br />
			<h:form id="form">
				<h:panelGrid columns="2">
					<h:panelGroup>
						<h:outputText value="#{msg['lt']}:" />
						<h:selectOneMenu id="type" required="true"
							value="#{calendarLeaveRequest.type}">
							<f:selectItem itemLabel="" itemValue="0" />
							<f:selectItem itemValue="AL" itemLabel="#{msg['AL']}" />
							<f:selectItem itemValue="SL" itemLabel="#{msg['SL']}" />
							<f:ajax event="change" execute="type" render="cal"></f:ajax>
						</h:selectOneMenu>
					</h:panelGroup>
					<h:outputText value="" />
					<rich:calendar id="cal" showFooter="false" showWeeksBar="false"
						popup="false" mode="ajax" boundaryDatesMode="scroll"
						dataModel="#{calendarLeaveRequest}">
					</rich:calendar>

					<h:panelGrid columns="1" style="text-align: left">
						<h:outputText value="#{msg['we']}" styleClass="wdc" />
						<h:outputText value="#{msg['ph']}" styleClass="phc" />
						<h:outputText value="" />
						<h:outputText value="" />
						<h:outputText value="#{msg['apl']}" styleClass="lac" />
						<h:outputText value="#{msg['pl']}" styleClass="lpc" />
					</h:panelGrid>
				</h:panelGrid>
			</h:form>

		</center>
	</f:view>
</body>
</html>
